import logging


class logging_hand(logging.Logger):
    def __init__(self,
                 name='root',
                 level='DEBUG',
                 file='demo1.txt',
                 fmat='%(filename)s-%(lineno)s-%(name)s-%(levelname)s-%(message)s'):
        super().__init__(name)
        #super(logging_hand, self).__init__(name)
        self.setLevel(level)

        file_handler = logging.FileHandler(file)

        file_handler.setLevel(level)

        fmt = logging.Formatter(fmat)
        file_handler.setFormatter(fmt)

        self.addHandler(file_handler)




if __name__ == '__main__':
    logger = logging_hand(name='python25', level='DEBUG', file='demo1.txt')
    logger.info('lll')
